package com.doge.controller.wx;

import com.doge.bean.base.BaseData;
import com.doge.bean.base.BaseRespVo;
import com.doge.bean.pojo.topic.Topic;
import com.doge.bean.vo.topic.TopicReadVO;
import com.doge.service.wx.topic.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: doge
 * @description: 主题控制
 * @author: Mr.Jiang
 * @create: 2021-12-02 15:59
 **/
@RequestMapping("wx/topic")
@RestController
public class WxTopicController {
    @Autowired
    WxTopicService wxTopicService;
    @RequestMapping("list")
    public BaseRespVo list(Integer page,Integer limit){
        BaseData baseData=wxTopicService.list(page,limit);
        return BaseRespVo.ok(baseData);
    }
    @RequestMapping("detail")
    public BaseRespVo  detail(Integer id){
        TopicReadVO topicReadVO=wxTopicService.detail(id);
        return BaseRespVo.ok(topicReadVO);
    }
    @RequestMapping("related")
    public BaseRespVo related(Integer id){
        BaseData baseData=wxTopicService.related();
        return BaseRespVo.ok(baseData);
    }
}
